package cn.tedu.boot011.controller;

import com.sun.deploy.net.HttpResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;


@Controller
public class HelloController {
//    @RequestMapping("/hello")
//    public void hello(HttpServletResponse response) throws IOException {
//        //设置响应头
//        response.setContentType("text/html;charset=utf-8");
//        //获取输出对象
//        PrintWriter pw = response.getWriter();
//        pw.println("服务器收到响应");
//        pw.close();
//
//    }
    @RequestMapping("/hello")
    @ResponseBody
    public String hello() {
        return "服务器哈哈哈哈哈了";
    }
}
